<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
	<c:import url="/WEB-INF/module/head.jsp"/>

	<body class="hold-transition skin-blue sidebar-mini" ng-app="blog" ng-controller="chapterController" ng-init="editInit()">
		<section class="content-header">
			<h1>文章<small>发布</small></h1>
			<ol class="breadcrumb">
				<li><a href="home.jsp"><i class="fa fa-dashboard"></i> 首页</a></li>
				<li><a href="list_chapter.jsp">文章</a></li>
				<li class="active">添加文章</li>
			</ol>
		</section>

		<!-- Main content -->
		<section class="content">
			<div class="row">
				<form>
					<div class="col-md-12">
						<div class="box box-success">
							<div class="box-header">
								<h3 class="box-title">基本信息<small>Basic information</small></h3>
								<div class="pull-right box-tools">
									<button type="button" class="btn btn-success btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse">
										<i class="fa fa-minus"></i></button>
								</div>
							</div>
							<div class="box-body">
								<div class="form-group">
									<label>标题</label>
									<input ng-model="entity.title" type="text" class="form-control" placeholder="请输入标题 ....">
								</div>
								<div class="form-group">
									<label>分类</label>
									<select id="categoryIdList" ng-model="entity.categoryIdList" data-placeholder="请选择分类" multiple="multiple" class="form-control select2" style="width: 100%;">
										<option ng-repeat="c in categoryList" value="{{c.id}}">{{c.name}}</option>
									</select>
								</div>
								<div class="form-group">
									<label>标签</label>
									<select ng-model="entity.labelIdList" data-placeholder="请选择标签" multiple="multiple" class="form-control select2" style="width: 100%;">
										<option ng-selected="labelSelect(c.id)" ng-repeat="c in labelList" value="{{c.id}}">{{c.name}}</option>
									</select>
								</div>
								<div class="form-group">
									<label>排序</label>
									<input ng-model="entity.serial" ng-init="entity.serial = 0" type="text" class="form-control" placeholder="请输入排序号 ....">
								</div>
								<div class="form-group">
									<label>封面图片地址</label>
									<input ng-model="entity.imgUrl" ng-init="entity.serial = 0" type="text" class="form-control" placeholder="请输入图片地址 ....">
								</div>
							</div>
						</div>

						<div class="box box-info">
							<div class="box-header">
								<h3 class="box-title">内容<small>Enter article content</small></h3>
								<div class="pull-right box-tools">
									<button type="button" class="btn btn-info btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse">
										<i class="fa fa-minus"></i></button>
								</div>
							</div>
							<div class="box-body pad">
								<ul class="nav nav-tabs">
									<li class="active"><a href="#ckeditor" data-toggle="tab">富文本编辑器</a></li>
								</ul>
								<div class="nav-tabs-custom">
									<div class="tab-content">
										<div class="active tab-pane" id="ckeditor">
											<textarea ng-model="entity.content" id="content" rows="10" cols="80"></textarea>
										</div>
									</div>
								</div>

							</div>
						</div>

						<div class="box box-danger">
							<div class="box-header">
								<h3 class="box-title">操作<small>Handle</small></h3>
								<div class="pull-right box-tools">
									<button type="button" class="btn btn-danger btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse">
										<i class="fa fa-minus"></i></button>
								</div>
							</div>
							<div class="box-body">
								<table class="table table-condensed text-center">
									<tr>
										<td style="border-width: 0px;">
											<button ng-click="edit('list_chapter.jsp');" type="button" class="btn btn-block btn-success">
												<font style="vertical-align: inherit;">保存</font>
											</button>
										</td>
										<td style="border-width: 0px;">
											<a href="list_chapter.jsp" class="btn btn-block btn-danger">
												<font style="vertical-align: inherit;">
													返回
												</font>
											</a>
										</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</form>
			</div>
			<!-- /.row -->
		</section>
		<!-- /.content -->

		<c:import url="/WEB-INF/module/js.jsp"/>

	</body>
</html>
